package edu.nf.postlikework.service.impl;

import edu.nf.postlikework.mapper.UserMapper;
import edu.nf.postlikework.model.entity.User;
import edu.nf.postlikework.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 *
 * @author zjl
 * @date 2025/10/13
 */
@Service
@RequiredArgsConstructor
public class UserServiceImpl implements UserService {
    private final UserMapper userMapper;
    @Override
    public User getUser(String username) {
        User user = userMapper.getUserByName(username);
        if(user == null){
            throw new RuntimeException("用户不存在");
        }
        return user;
    }
}
